﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;

namespace MTO.Library.Web.Controllers.Themes
{
    public class ThemesController : Controller
    {
        public void ChangeTheme(string id)
        {
            var cookie = new HttpCookie("theme", id);

            cookie.Expires = DateTime.Now.AddYears(10);
            this.HttpContext.Response.Cookies.Add(cookie);

            if (Request.UrlReferrer != null)
            {
                Response.Redirect(Request.UrlReferrer.AbsoluteUri);
            }
            else
            {
                Response.Redirect("/");
            }
        }
    }
}
